<%--
 *  File:    ProdEditUM.jsp
 *  @Author: Langerwang 
 *  Date:    2001/01/14
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.ProdEditUM");  
  String privilegeCode = "10203,L203";
  String strModuleName = "PCM";
%>



<%
  String strProdId = (String)request.getParameter("prodid");
  if(strProdId == null)
  {
    strProdId = (String)((HashMap)session.getAttribute("productinfo")).get("prodid").toString();
  }    
%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>ProdEditUM</title>
<PageFlow:CheckPageFlow pageName="prodeditum"/>
<%@ include file="/inc/InitEdit.inc" %>
<%
  Vector umCode = (Vector)pageContext.getAttribute("allumcode");
  if(umCode == null)
  {
    umCode = new Vector();
  }
  cat.debug("umCode is " + umCode);
  
  Vector prodUMs = (Vector)pageContext.getAttribute("allprodum");
  if(prodUMs == null)
  {
    prodUMs = new Vector();
  }
  cat.debug("prodUMs is " + prodUMs);
%><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<script language="JavaScript">
function page_back()
{
  parent.up.page_goback();
}
</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border=0 cellpadding=0 cellspacing=0 width="100%">
  <tr> 
    <td valign=top>
      <table border=0 cellpadding=1 cellspacing=0 width="100%">
       <tbody> 
    <tr> 
          <td bgcolor=#000000 style="PADDING-BOTTOM: 1px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 0px"> 
            <table bgcolor=#000000 border=0 cellpadding=0 cellspacing=0 width="100%">
              <tr> 
                <td  bgcolor=#ffffff style="PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; PADDING-TOP: 3px"> 
                  <div id=div1 style="HEIGHT: 450px; OVERFLOW: auto">
                  
        <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="0">
          <tr> 
            <td colspan="7" class="deepblue-left"> <img src="../../images/<%= strLanguageCode %>/quote.gif"> 
              <%= label.getLabelName("L_OtherAvailableUnit") + label.getLabelName("L_Colon") %> </td>
          </tr>
          
          <tr class="td-listrom"> 
            <td class="title_center" >&nbsp;<%= label.getLabelName("L_UnitName") %></td>
            <td class="title_center" >&nbsp;<%= label.getLabelName("L_Factor1") %></td>
            <td class="title_center" >&nbsp;<%= label.getLabelName("L_BasicUnit") %></td>
            <td class="title_center" >&nbsp;<%= label.getLabelName("L_Factor2") %></td>
            <td class="title_center" >&nbsp;<%= label.getLabelName("L_DecimalDigits") %></td>
            <td class="title_center">&nbsp;<%= label.getLabelName("L_Comment") %></td>
          </tr>

          <%
            String baseUm = "";
            String baseFlag = "";
            HashMap basehash = new HashMap();
            int i = 0;
            String strClassType = new String("td-listrom");
            for(int k = 0; k < prodUMs.size() ;k++)
            {
              HashMap temp = (HashMap)prodUMs.get(k);
              if(temp.get("baseflag") != null && temp.get("baseflag").toString().equalsIgnoreCase("Y"))
              {
                baseUm = (String)temp.get("umname");
                basehash = temp;
                prodUMs.remove(k);
                k--;
              }
            }            
          %>
        <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='none'" class="none">
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( basehash.get("umname") )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( basehash.get("factor") )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( baseUm )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( basehash.get("factor2") )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( basehash.get("scale") )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( basehash.get("memo") )%></td>
        </tr>

            <logic:iterate id="produm" collection="<%= prodUMs %>">   
          <%
            HashMap umMap = (HashMap)pageContext.getAttribute("produm");  
            if(i%2 == 1){
              strClassType = "td-listrom";
            }else{                    
              strClassType = "";
            } 
            if(umMap.get("baseflag") != null)
              baseFlag = (String)umMap.get("baseflag"); 
            i++;        
          %>                  
        <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='none'" class="none">
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( umMap.get("umname") )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( umMap.get("factor") )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( baseUm )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( umMap.get("factor2") )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( umMap.get("scale") )%></td>
          <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( umMap.get("memo") )%></td>
        </tr>
          </logic:iterate> 
        </table>
        </div> 
      </td>
    </tr>  
   </table>     
  </td>
 </tr>
 </tbody>
</table>
      </td>
  </tr>
  <tr>
    <td class="summary_top"></td>
  </tr>
  <tr> 
   <td class="td_center">
      <a onclick="page_back()"><custom:button type="1" label="L_Back" imgsrc="back.gif" border="0" style="width:60"/></a>
   </td>
  </tr>
     
</table>
</body>
</html>


